package main

import (
	"encoding/json"
	"fmt"
	"gopkg.in/yaml.v3"
	"io/ioutil"
	v1 "k8s.io/api/apps/v1"
	"os"
)

func main() {
	f, err := os.Open("D:\\gopath\\src\\operator\\test\\1\\1.yaml")
	if err != nil {
		fmt.Println(err)
		return
	}
	data, _ := ioutil.ReadAll(f)
	d := &v1.Deployment{}
	m := make(map[string]interface{})
	err = yaml.Unmarshal(data, &m)
	if err != nil {
		fmt.Println(err)
		return
	}

	data, _ = json.Marshal(m)
	fmt.Println(string(data))
	json.Unmarshal(data, d)

	fmt.Println(d)
}
